home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / PInterfaces / ConditionalMacros.p < prev    next >
Encoding:
Text File  |  1996-09-11  |  5.9 KB  |  171 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ConditionalMacros.p
  3.  
  4.      Contains:    Compile time feature switches to achieve platform independent sources.
  5.  
  6.      Version:    Technology:    Universal Interface Files 2.1
  7.                  Package:    Universal Interfaces 2.1.4 
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT ConditionalMacros;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __CONDITIONALMACROS__}
  30. {$SETC __CONDITIONALMACROS__ := 1}
  31.  
  32. {$I+}
  33. {$SETC ConditionalMacrosIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36. {
  37.  
  38.     Set up UNIVERSAL_INTERFACES_VERSION
  39.     
  40.         0x210 => version 2.1
  41.         This conditional did not exist prior to version 2.1
  42. }
  43. {$SETC UNIVERSAL_INTERFACES_VERSION := $0210}
  44.  
  45. {***************************************************************************************************
  46.     
  47.     GENERATINGPOWERPC        - Compiler is generating PowerPC instructions
  48.     GENERATING68K            - Compiler is generating 68k family instructions
  49.  
  50.         Invariant:
  51.             GENERATINGPOWERPC != GENERATING68K
  52.             
  53. ***************************************************************************************************}
  54. {$IFC NOT UNDEFINED GENERATINGPOWERPC }
  55.   {$IFC UNDEFINED GENERATING68K }
  56.     {$SETC GENERATING68K := NOT GENERATINGPOWERPC }
  57.   {$ENDC}
  58. {$ENDC}
  59.  
  60. {$IFC NOT UNDEFINED GENERATING68K }
  61.   {$IFC UNDEFINED GENERATINGPOWERPC }
  62.     {$SETC GENERATINGPOWERPC := NOT GENERATING68K }
  63.   {$ENDC}
  64. {$ENDC}
  65.  
  66. {$IFC UNDEFINED GENERATINGPOWERPC }
  67.   {$IFC NOT UNDEFINED MWERKS }
  68.     {$SETC GENERATINGPOWERPC := POWERPC }
  69.   {$ELSEC}
  70.     {$IFC NOT UNDEFINED LSPWRP }
  71.       {$SETC GENERATINGPOWERPC := 1 }
  72.     {$ELSEC}
  73.       {$SETC GENERATINGPOWERPC := 0 }
  74.     {$ENDC}
  75.   {$ENDC}
  76. {$ENDC}
  77.  
  78. {$IFC UNDEFINED GENERATING68K }
  79.     {$SETC GENERATING68K := NOT GENERATINGPOWERPC }
  80. {$ENDC}
  81. {***************************************************************************************************
  82.     
  83.     GENERATING68881            - Compiler is generating mc68881 floating point instructions
  84.     
  85.         Invariant:
  86.             GENERATING68881 => GENERATING68K
  87.             
  88. ***************************************************************************************************}
  89. {$IFC GENERATING68K AND OPTION(mc68881) }
  90. {$SETC GENERATING68881 := 1 }
  91. {$ENDC}
  92. {$IFC UNDEFINED GENERATING68881 }
  93. {$SETC GENERATING68881 := 0}
  94. {$ENDC}
  95. {***************************************************************************************************
  96.     
  97.     GENERATINGCFM            - Code being generated assumes CFM calling conventions
  98.     CFMSYSTEMCALLS            - No A-traps.  Systems calls are made using CFM and UPP's
  99.  
  100.         Invariants:
  101.             GENERATINGPOWERPC => GENERATINGCFM
  102.             GENERATINGPOWERPC => CFMSYSTEMCALLS
  103.             CFMSYSTEMCALLS => GENERATINGCFM
  104.             
  105. ***************************************************************************************************}
  106. {$SETC GENERATINGCFM := GENERATINGPOWERPC}
  107. {$SETC CFMSYSTEMCALLS := GENERATINGPOWERPC}
  108.  
  109. {***************************************************************************************************
  110.     
  111.     SystemSevenFiveOrLater    - Compiled code will only be run on a System 7.5 or later Macintosh
  112.     SystemSevenOrLater        - Compiled code will only be run on a System 7.0 or later Macintosh
  113.     SystemSixOrLater        - Compiled code will only be run on a System 6.0 or later Macintosh
  114.                               A developer should set the appropriate flag on the compiler command-
  115.                               line or in a file processed before this file.  This will allow the
  116.                               certain optimizations to be made which can result in smaller, faster
  117.                               applications.
  118.  
  119.  
  120. ***************************************************************************************************}
  121. {$IFC UNDEFINED SystemSevenFiveOrLater }
  122. {$SETC SystemSevenFiveOrLater := 0}
  123. {$ENDC}
  124. {$IFC UNDEFINED SystemSevenOrLater }
  125.  {$IFC GENERATINGCFM }
  126. {$SETC SystemSevenOrLater := 1}
  127.  {$ELSEC}
  128. {$SETC SystemSevenOrLater := SystemSevenFiveOrLater}
  129.  {$ENDC}
  130. {$ENDC}
  131. {$IFC UNDEFINED SystemSixOrLater }
  132. {$SETC SystemSixOrLater := SystemSevenOrLater}
  133. {$ENDC}
  134. {***************************************************************************************************
  135.  
  136.     OLDROUTINENAMES            - "Old" names for Macintosh system calls are allowed in source code.
  137.                               (e.g. DisposPtr instead of DisposePtr). The names of system routine
  138.                               are now more sensitive to change because CFM binds by name.  In the 
  139.                               past, system routine names were compiled out to just an A-Trap.  
  140.                               Macros have been added that each map an old name to its new name.  
  141.                               This allows old routine names to be used in existing source files,
  142.                               but the macros only work if OLDROUTINENAMES is true.  This support
  143.                               will be removed in the near future.  Thus, all source code should 
  144.                               be changed to use the new names! You can set OLDROUTINENAMES to false
  145.                               to see if your code has any old names left in it.
  146.     
  147.     OLDROUTINELOCATIONS     - "Old" location of Macintosh system calls are used.  For example, c2pstr 
  148.                               has been moved from Strings to TextUtils.  It is conditionalized in
  149.                               Strings with OLDROUTINELOCATIONS and in TextUtils with !OLDROUTINELOCATIONS.
  150.                               This allows developers to upgrade to newer interface files without suddenly
  151.                               all their code not compiling becuase of "incorrect" includes.  But, it
  152.                               allows the slow migration of system calls to more understandable file
  153.                               locations.  OLDROUTINELOCATIONS currently defaults to true, but eventually
  154.                               will default to false.
  155.  
  156. ***************************************************************************************************}
  157. {$IFC UNDEFINED OLDROUTINENAMES }
  158. {$SETC OLDROUTINENAMES := 1}
  159. {$ENDC}
  160. {$IFC UNDEFINED OLDROUTINELOCATIONS }
  161. {$SETC OLDROUTINELOCATIONS := 1}
  162. {$ENDC}
  163.  
  164. {$SETC UsingIncludes := ConditionalMacrosIncludes}
  165.  
  166. {$ENDC} {__CONDITIONALMACROS__}
  167.  
  168. {$IFC NOT UsingIncludes}
  169.  END.
  170. {$ENDC}
  171.